﻿<%@ Import Namespace="Blog.Models"%>
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%
   DataDataContext db=new DataDataContext();
   foreach (var x in db.Catalogs)
   {
       var y = from c in db.Articles
               where(c.CatalogId == x.CatalogId&& x.Status==true)
               select c;
       if (x.Status == true)
           ViewData["BODY"] = y.ToArray().Last().Introduce;
           {%>     
       <div id="menucontainer">           
             <ul id="menu"> 
               <li><%=Html.ActionLink(x.CatalogName, "Index", new { Controller = "Menu", id = y.ToArray().Last().CatalogId })%></li>
             </ul>
       </div>      
       <h2><%=Html.ActionLink(y.ToArray().Last().TiTle, "Details", new { Controller = "Menu", id = y.ToArray().Last().ArticleId})%></h2>
       <p>
       <%=ViewData["BODY"] %>
       </p>
  
<%} %>
<%} %>
